function p=draw_2Dtruss_mesh(nodes,p,color_str)
    xy=zeros(size(p.elems,2)*p.elem_num,size(p.nodes,2));
    cur1=1;
    cur2=0;
    for i =1:p.elem_num
        
        connectivity=p.elems(i,:);
        attach_node_num=size(connectivity,2);
        
        cur1=cur2+1;
        cur2=cur2+attach_node_num;
        
        coord=zeros(attach_node_num,size(p.nodes,2));
        for j=1:size(connectivity,2)
            coord(j,:)=nodes(connectivity(j),:);
        end
    
        xy(cur1:cur2,:)=coord;
    end
    p=line(xy(:,1),xy(:,2),"Marker","o","LineWidth",1,"Color",color_str);
end